package com.rykj.qxj.test.xtest;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class ChaMap {

	public static void main(String[] args) {
		
		  List<Map<String, Object>> l = new ArrayList<Map<String, Object>>();  
	        Map<String, Object> oneMap = new HashMap<String, Object>();  
	        oneMap.put("count", "8000");  
	        oneMap.put("count1", "12");  
	        oneMap.put("time", "14:25");  
	        //l.add(oneMap);  
	      /*  Map<String, Object> twoMap = new HashMap<String, Object>();  
	        twoMap.put("count", "8008");  
	        twoMap.put("count1", "16");  
	        twoMap.put("time", "14:30");  
	        l.add(twoMap);  */
	        
	     /*   Map<String, Object> threeMap = new HashMap<String, Object>();  
	        threeMap.put("count", "8087");  
	        threeMap.put("count1", "19");  
	        threeMap.put("time", "14:35");  
	        l.add(threeMap);  
	        
	        Map<String, Object> fourMap = new HashMap<String, Object>();  
	        fourMap.put("count", "9014");  
	        fourMap.put("count1", "89");  
	        fourMap.put("time", "14:40");  
	        l.add(fourMap);  */
	        
	        List<Map<String,Object>> resList=new ArrayList<Map<String,Object>>();
	        if(l!=null&&l.size()>0) {
	        for(int i=0;i<l.size();i++) {
	        	Map<String,Object> temp=new HashMap<String,Object>();
	        	if(l.size()==1) {
	        		temp.put("time", l.get(i).get("time"));
		        	temp.put("sub", l.get(i).get("count"));
		        	resList.add(temp);
	        	}
	        	if(i+1==l.size()) {
	        		break;
	        	}
	        	double one = Double.parseDouble(l.get(i).get("count").toString());
	        	double two = Double.parseDouble(l.get(i+1).get("count").toString());
	        	double sub=two-one;
	        	System.out.println(sub);
	        	int count1=Integer.parseInt(l.get(i).get("count1").toString());
	        	int count2=Integer.parseInt(l.get(i+1).get("count1").toString());
	        	int subCount=count2-count1;
	        	System.out.println(subCount);
	        	temp.put("time", l.get(i+1).get("time"));
	        	temp.put("sub", sub/subCount);
	        	resList.add(temp);
	        	}
	       }
	        System.out.println(resList);
	        
	        double d = 3.1415926;
	        String result = String.format("%.2f", d);
	        System.out.println(result);
	        
	        double countValue = Double.parseDouble("34.89".toString());
	        System.out.println(countValue);
	        
	        SimpleDateFormat sDateFormat=new SimpleDateFormat("yyyy-MM-dd hh");   
	        String date=sDateFormat.format(new Date());  
	        System.out.println(date);
	        
	        
	        Map<String,Object> aa=new HashMap<String,Object>();
	        aa.put("ss", 12);
	        
	        System.out.println(aa.get("dd"));
	        
	        Set<String> testSet=new HashSet<>();
	        testSet.add("aa");
	       System.out.println( testSet.remove("cc"));
	        

	}

}
